package hos.demo.dialog;

import android.content.Context;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import cjf.app.R;
import hos.base.dialog.BaseAppCompatDialog;

/**
 * <p>Title: DialogTip </p>
 * <p>Description:  </p>
 * <p>Company: www.mapuni.com </p>
 *
 * @author : 蔡俊峰
 * @version : 1.0
 * @date : 2024-05-13 9:03
 */
public class AppCompatDialogTip extends BaseAppCompatDialog {
    public AppCompatDialogTip(@NonNull Context context) {
        super(context);
    }

    public AppCompatDialogTip(@NonNull Context context, int themeResId) {
        super(context, themeResId);
    }

    @NonNull
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return inflater.inflate(R.layout.dialog_tip, container, false);
    }

    @Override
    public void onViewShowed(View view) {
        view.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(getContext(),"这是一个自定义对话框",Toast.LENGTH_SHORT).show();
            }
        });
    }
}
